package com.seari.c3gallery.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/socket").setAllowedOrigins("*").withSockJS();
    }

    @Override
    public void configureMessageBroker(MessageBrokerRegistry config){
        /**
         * keyCmd:模式二PPT展示控制项 (暂停使用)
         * displayMod:模式二左右两侧展示页切换项 (暂停使用)
         * dailyMod:模式三四展示页切换项
         * profession:模式一中间展示切换项
         * reportMod:模式一二左右展示切换项
         * menuContro 大屏与Ipad控制系统的菜单联动
         */
        config.enableSimpleBroker("/user","/keyCmd","/displayMod","/dailyMod","/profession","/reportMod");
    }
}
